<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://www.codecoord.com" %>
<%@ taglib prefix="fmt" uri="http://www.fmt.com" %>
<!DOCTYPE html>
<html lang="en" class="fly-html-layui fly-html-store">
<head>
          <%
        pageContext.setAttribute("APP_PATH", request.getContextPath());
    %>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link rel="stylesheet" href="${APP_PATH}/statics/front/layui/dist/css/layui.css">
     <link rel="stylesheet" href="${APP_PATH}/statics/front/css/global.css" charset="utf-8">
     <link rel="stylesheet" href="${APP_PATH}/statics/front/css/global(1).css" charset="utf-8">
     <link rel="stylesheet" href="${APP_PATH}/statics/front/css/store.css" charset="utf-8">
     <link rel="icon" href="${APP_PATH}/statics/front/images/favicon.ico">
     <title>shop商城</title>
<body>
<!-- 顶部start -->
<div class="layui-header header header-store" style="background-color: #393D49;">
     <div class="layui-container">
          <a class="logo" href="index.html">
               <img src="${APP_PATH}/statics/front/images/logo.png" alt="layui">
          </a>
          <div class="layui-form component" lay-filter="LAY-site-header-component"></div>

          <ul class="layui-nav" id="layui-nav-userinfo">
               <li data-id="index" class="layui-nav-item layui-hide-xs"><a class="fly-case-active" data-type="toTopNav"
                                                                                      href="/index.html">首页</a></li>
               <li data-id="room" class="layui-nav-item layui-hide-xs"><a class="fly-case-active"
                                                                          data-type="toTopNav"
                                                                          href="/items/list.html">商品类型</a></li>
               <li data-id="register" class="layui-nav-item layui-hide-xs "><a class="fly-case-active" data-type="toTopNav"
                                                                               href="/notice.html">商城公告</a></li>
               <li data-id="login" class="layui-nav-item layui-hide-xs "><a class="fly-case-active" data-type="toTopNav"
                                                                            href="/login.jsp">登入</a></li>
               <li data-id="register" class="layui-nav-item layui-hide-xs "><a class="fly-case-active" data-type="toTopNav"
                                                                               href="/register.jsp">注册</a></li>
               <li data-id="register" class="layui-nav-item layui-hide-xs layui-this"><a class="fly-case-active" data-type="toTopNav"
                                                                               href="/user/toUser.html">个人中心</a></li>
               <span class="layui-nav-bar" style="left: 560px; top: 55px; width: 0px; opacity: 0;"></span></ul>
     </div>
</div>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;" id="top1">
     <legend><h1>个人基本信息</h1></legend>
</fieldset>
<div style="width:100%;padding-top: 20px;">
     <form class="layui-form" action="" id="updateUserInfo">
          <input type="hidden" name="id" id="id" value="${user.id}">
          <div class="layui-form-item" style="width: 360px;">
               <label class="layui-form-label">账号名：</label>
               <div class="layui-input-block">
                    <input  style="border: none" readonly type="text" name="loginName" id="sno" lay-verify="required" autocomplete="off"  class="layui-input" value="${user.loginName}">
               </div>
          </div>
          <div class="layui-form-item" style="width: 360px;">
               <label class="layui-form-label">真实姓名：</label>
               <div class="layui-input-block">
                    <input style="border: none"  type="text" name="realName" id="name"  value="${user.realName}"  lay-verify="pass"  autocomplete="off" placeholder="请输入真实姓名" class="layui-input">
               </div>
          </div>
          <div class="layui-form-item" style="width: 360px;">
               <label class="layui-form-label">电话号码：</label>
               <div class="layui-input-block">
                    <input style="border: none"  type="text" name="phone" id="suj" value="${user.phone}" lay-verify="pass" autocomplete="off" placeholder="请输入你的电话号码" class="layui-input">
               </div>
          </div>
          <div class="layui-form-item" style="width: 360px;">
               <label class="layui-form-label">邮箱：</label>
               <div class="layui-input-block">
                    <input style="border: none" type="text" name="email" id="classes" value="${user.email}" lay-verify="pass" autocomplete="off" placeholder="请输入你的邮箱" class="layui-input">
               </div>
          </div>
          <div class="layui-form-item" style="width: 360px;">
               <label class="layui-form-label">备注：</label>
               <div class="layui-input-block">
                    <textarea   style="border: none" name="note"  text="${user.note}"   class="layui-textarea"></textarea>
               </div>
          </div>
          <div class="layui-form-item login-btn">
               <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="modify" style="background-color: #272727">完善/修改用户信息</button>
               </div>
          </div>
     </form>
     <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;" id="top">
          <legend><h1>订单基本信息</h1></legend>
     </fieldset>
     <table class="layui-table">
          <colgroup>
               <col width="150">
               <col width="200">
               <col>
          </colgroup>
          <thead>
          <tr>
               <th>订单号</th>
               <th>预订人</th>
               <th>手机号</th>
               <th>商品名称</th>
               <th>数量</th>
               <th>价格</th>
               <th>下单时间</th>
               <th>订单状态</th>
          </tr>
          </thead>
          <c:forEach var="orders" items="${ordersList}" varStatus="stauts">
               <tr>
                    <td>${orders.ordersNo}</td>
                    <td>${orders.reservationName}</td>
                    <td>${orders.phone}</td>
                    <td>${orders.itemsName}</td>
                    <td>${orders.counts}</td>
                    <td>${orders.reservePrice}</td>
                    <td><fmt:formatDate value="${orders.reserveDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td>
                         <c:if test="${orders.status==1}">已下单</c:if>
                         <c:if test="${orders.status==2}">处理中</c:if>
                         <c:if test="${orders.status==3}">已完成</c:if>
                    </td>
               </tr>
          </c:forEach>

          </tbody>
     </table>
</div>
<!-- 底部 -->
<div class="fly-footer">
     <p><a href="#">shop商城</a> 2021 © <a href="#">test.cn</a></p>
     <p>
          友情链接
          <a href="http://java.goodym.cn" target="_blank">java项目源码分享网</a>
          <a href="http://www.goodym.cn/code/list/all/1/20.html" target="_blank">源码下载平台</a>
          <a href="http://www.goodym.cn/market/list/all/1/20.html" target="_blank">源码市场</a>
          <a href="http://www.goodym.cn/resumetemplate/list/1/20.html" target="_blank">简历制作</a>
          <a href="http://www.goodym.cn/forum/list/0/1/20.html" target="_blank">社区论坛</a> </p>

</div>
</body>
</html>
<script src="${APP_PATH}/statics/front/layui/dist/layui.js"></script>
<script>
    layui.use(['form', 'table','laydate','jquery'], function () {
        var $ = layui.jquery,
            form = layui.form,
            laydate = layui.laydate,
            table = layui.table;
        //触发修改用户信息
        //表单提交事件
        form.on("submit(modify)",function (data) {
            $.post("/user/perfect",data.field,function(result){
                layer.alert(result.message);
            },"json");
            return false;
        });
    });
</script>

